package com.lagou.worker.dao;

import com.lagou.worker.model.LagouAuthCode;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

/**
 * @ClassName LagouAuthCodeDao
 * @Description TODO
 * @Author xsq
 * @Date 2020/7/28 16:40
 **/
@Repository
public interface LagouAuthCodeDao extends JpaRepository<LagouAuthCode, Integer> {

    @Query(value ="select * from lagou_auth_code where email=?1 order by createtime desc limit 1",nativeQuery = true)
    LagouAuthCode getLagouAuthCodeByEmail(String email);

}
